package com.ruoyi.passenger.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.system.api.model.LoginDriver;
import com.ruoyi.system.api.model.LoginPassenger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.passenger.mapper.VehiclePassengerMapper;
import com.ruoyi.passenger.domain.VehiclePassenger;
import com.ruoyi.passenger.service.IVehiclePassengerService;

/**
 * 乘客管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-26
 */
@Service
public class VehiclePassengerServiceImpl implements IVehiclePassengerService 
{
    @Autowired
    private VehiclePassengerMapper vehiclePassengerMapper;

    /**
     * 查询乘客管理
     * 
     * @param id 乘客管理主键
     * @return 乘客管理
     */
    @Override
    public VehiclePassenger selectVehiclePassengerById(Long id)
    {
        return vehiclePassengerMapper.selectVehiclePassengerById(id);
    }

    /**
     * 查询乘客管理列表
     * 
     * @param vehiclePassenger 乘客管理
     * @return 乘客管理
     */
    @Override
    public List<VehiclePassenger> selectVehiclePassengerList(VehiclePassenger vehiclePassenger)
    {
        return vehiclePassengerMapper.selectVehiclePassengerList(vehiclePassenger);
    }

    /**
     * 新增乘客管理
     * 
     * @param vehiclePassenger 乘客管理
     * @return 结果
     */
    @Override
    public int insertVehiclePassenger(VehiclePassenger vehiclePassenger)
    {
        vehiclePassenger.setCreateTime(DateUtils.getNowDate());
        return vehiclePassengerMapper.insertVehiclePassenger(vehiclePassenger);
    }

    /**
     * 修改乘客管理
     * 
     * @param vehiclePassenger 乘客管理
     * @return 结果
     */
    @Override
    public int updateVehiclePassenger(VehiclePassenger vehiclePassenger)
    {
        return vehiclePassengerMapper.updateVehiclePassenger(vehiclePassenger);
    }

    /**
     * 批量删除乘客管理
     * 
     * @param ids 需要删除的乘客管理主键
     * @return 结果
     */
    @Override
    public int deleteVehiclePassengerByIds(Long[] ids)
    {
        return vehiclePassengerMapper.deleteVehiclePassengerByIds(ids);
    }

    /**
     * 删除乘客管理信息
     * 
     * @param id 乘客管理主键
     * @return 结果
     */
    @Override
    public int deleteVehiclePassengerById(Long id)
    {
        return vehiclePassengerMapper.deleteVehiclePassengerById(id);
    }

    @Override
    public LoginPassenger getDataByMobile(String mobile) {
        return vehiclePassengerMapper.getDataByMobile(mobile);
    }

    @Override
    public LoginPassenger register(LoginPassenger loginPassenger) {
        Integer loginPassengerCount = vehiclePassengerMapper.register(loginPassenger);
        System.out.println("id"+loginPassenger.getId());
        return loginPassenger;
    }
}
